- 
                Notifications
    
You must be signed in to change notification settings  - Fork 353
 
Rewrite program cache #6608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite program cache #6608
Conversation
8ebeca0    to
    375b575      
    Compare
  
    b7e34a7    to
    dce26c1      
    Compare
  
    dce26c1    to
    805f08a      
    Compare
  
    62f8e14    to
    5ee2476      
    Compare
  
    | program_id, | ||
| &cache_entry )!=0 ) ) { | ||
| /* https://github.com/anza-xyz/agave/blob/v2.2.6/programs/loader-v4/src/lib.rs#L522-L528 */ | ||
| fd_progcache_rec_t const * cache_entry = | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this a concurrent access? The entry might get evicted before you can read executable etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will fix this in a follow-up PR. The purpose of this PR was to separate out the account database and the loaded program cache.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bf29fd5    to
    2e58ab1      
    Compare
  
    - Reduce funk key size to 32 bytes (from 40 bytes)
- Move program cache to separate funk instance and wksp
- Introduce program cache eviction policy
- Restructure program cache logic / general cleanup
  - Reduce verbosity in API documentation
  - Clean up API naming
  - Split up API into a few smaller headers
- Reduce program cache fill allocations and memory copies
  (directly populate calldests map, skip calldests map alloc for
  newer sBPF versions)
- Remove broken/unused concurrency model in previous program cache
  implementation
- Remove strict instruction logging requirements
  (no program cache tombstone entries for obviously invalid
  programs, such as invalid section table)
- Simplify cache invalidation logic ("queue program for re-
  verification"): now just inserts a tombstone
- Reuse cache entries across forks (cache entries tracked at fork
  graph nodes determined by program modify slot, instead of program
  load slot)
    2e58ab1    to
    1d05b87      
    Compare
  
    
          Performance Measurements ⏳
  | 
    
| 
           Changes are included in #6653  | 
    
(directly populate calldests map, skip calldests map alloc for
newer sBPF versions)
implementation